package com.apotik.legenda.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Type;

@Entity
@Table(name="apt_patients")
public class Patients implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="patient_id")
	private Long patientId;
	
	@Column(name="patient_name", length=25, nullable=false)
	private String patientName;
	
	@Column(name="phone_number", length=15)
	private String phoneNumber;
	
	@Temporal(TemporalType.DATE)
	@Column(name="birthdate")
	private Date birthdate;
	
	@Column(name="patient_age")
	private String patientAge;
	
	@Type(type="text")
	@Column(name="address")
	private String address;
	
	@Column(name="responsible_person", length=25, nullable=false)
	private String responsiblePerson;
	
	@Temporal(TemporalType.DATE)
	@Column(name="created_date", nullable = false)
	private Date createdDate;
	
	@Temporal(TemporalType.DATE)
	@Column(name="update_date")
	private Date updateDate;

	@ManyToOne
	@JoinColumn(name="sales_trx")
	private SalesTrx salesTrx;
	
	
	public Long getPatientId() {
		return patientId;
	}

	public void setPatientId(Long patientId) {
		this.patientId = patientId;
	}

	public String getPatientName() {
		return patientName;
	}

	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}

	public Date getBirthdate() {
		return birthdate;
	}

	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}
	
	public String getPatientAge() {
		return patientAge;
	}
	
	public void setPatientAge(String patientAge) {
		this.patientAge = patientAge;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getResponsiblePerson() {
		return responsiblePerson;
	}

	public void setResponsiblePerson(String responsiblePerson) {
		this.responsiblePerson = responsiblePerson;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}
	
	public Date getUpdateDate() {
		return updateDate;
	}
	
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	
	public SalesTrx getSalesTrx() {
		return salesTrx;
	}
	
	public void setSalesTrx(SalesTrx salesTrx) {
		this.salesTrx = salesTrx;
	}
	
}
